import axios from "../../http/axios.js";
import {
  apiGetHotServicesList,
  apiGetServiceByHospitalId
} from "../../http/server.js";

// 获取服务列表
export default function getServiceList(option) {
  return new Promise((resolve, reject) => {
    axios({
        url: apiGetHotServicesList,
        data: {
          page: option.page,
          pageSize: option.pageSize,
          name: option.name || "",
          type: option.type || ""
        }
      })
      .then(res => {
        resolve(res)
      })
  })
}

// 根据医院Id获取对应医院的服务列表
export function getServiceByHospitalId(option) {
  return new Promise((resolve, reject) => {
    axios({
        url: apiGetServiceByHospitalId,
        data: {
          page: option.page,
          pageSize: option.pageSize,
          hospitalId: option.hospitalId,
          name: option.name || "",
          type: option.type || ""
        }
      })
      .then(res => {
        resolve(res)
      })
  })
}